<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<%@ page session="false"%>

<link href="<c:url value="/resources/css/jqueryui/jquery-ui.css" />" rel="stylesheet" > </link>
<link href="<c:url value="/resources/css/shopizer-admin.css" />" rel="stylesheet" > </link>
<script src="<c:url value="/resources/js/jqueryui/jquery.js" />" ></script>
<script src="<c:url value="/resources/js/jqueryui/jquery-ui.js" />" ></script>
<script src="<c:url value="/resources/js/report.js" />" ></script>


<div class="tabbable">
	<jsp:include page="/common/adminTabs.jsp" />

	<div class="tab-content">
		<div class="tab-pane active" id="report">
			<div class="box">
				<span class="box-title">
					<h3>
						<s:message code="label.reports.order.title" text="Order Report" />
					</h3>
					<br />
				</span>

				<div id="searchCriteria">
					<c:url var="reportQuery" value="/admin/reports/order.html"/>
					<form action="${reportQuery}" method="POST" id="postForm">
						<table style="width: 70%">
							<tr>
								<td><s:message code="report.text.fromDate" text="From Date" />: &nbsp;
									<input id="fromDate" name="fromDate" style="width: 100px;" value="${fromDate}"/>
								</td>
								<td align="right"><s:message code="report.text.toDate" text="To Date" />: &nbsp;
									<input id="toDate" name="toDate" style="width: 100px;" value="${toDate}"/>
								</td>
							</tr>
							<tr>
								<td colspan="2" align="right">
									<button type="submit">
										<s:message code="button.label.search" text="Search"/>
									</button>
								</td>
							</tr>
						</table>
					</form>
				</div>
				
				<div>
					<c:if test="${!empty result }">
						<div style="float: right; margin-bottom: 2px;">
							<a id="exportPdf" href="<c:url value="/admin/reports/order/pdf.html" />" >
								<img class="icon" alt="Export PDF" src="<c:url value="/resources/img/pdf.jpg" />" />
							</a>
							<a id="exportExcel" href="<c:url value="/admin/reports/order/excel.html"/>" >
								<img class="icon" alt="Export Excel" src="<c:url value="/resources/img/excel.png" /> "/>
							</a>
						</div>
						<div  id="result">
							${result}
						</div>
					</c:if>
				</div>
			</div>
		</div>

	</div>
</div>